<!DOCTYPE html>
<html>

  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width initial-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title>{% if page.title %}{{ page.title }}{% else %}{{ site.title }}{% endif %}</title>
    <meta name="description" content="{{ site.description }}">

    {% if page.canonical_url and page.canonical_url != page.url %}
    <link rel="canonical" href="{{ page.canonical_url | replace: 'index.html', '' }}">
    <meta http-equiv="refresh" content="0; url={{ page.canonical_url | replace: 'index.html', '' }}" />
    <script>
      window.location.href = '{{ page.canonical_url | replace: 'index.html','' }}';
    </script>
    {% else %}
    <link rel="canonical" href="{{ page.url | replace: 'index.html', '' | prepend: site.baseurl | prepend: site.url }}">
    {% endif %}

    {% if page.css_uris %}
    {% for css_uri in page.css_uris %}
    <link rel="stylesheet" href="{{ css_uri }}">
    {% endfor %}
    {% endif %}

    <link rel="stylesheet" type="text/css" href="{{ site.baseurl}}/bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}">
    {% comment %}<link rel="stylesheet" type="text/css" media="screen" href={{ "/css/toc.css" | prepend: site.baseurl}}>{% endcomment %}

    {% if page.script_uris %}
    {% for script_uri in page.script_uris %}
    <script type="text/javascript" src="{{ script_uri }}"></script>
    {% endfor %}
    {% endif %}

    <script type="text/javascript" src={{ "/js/jquery.js" | prepend: site.baseurl }}></script>
    <script src={{ "/bootstrap/js/bootstrap.min.js" | prepend: site.baseurl }} type="text/javascript"></script>
    <script src={{ "/js/jquery-cookie-1.4.1/jquery.cookie.js" | prepend: site.baseurl }} type="text/javascript"></script>

    {% include_cached google_analytics.html %}
    <script type="text/javascript" src={{ "/js/toc.js" | prepend: site.baseurl }}></script>

    <script src={{ "/js/distro_switch.js" | prepend: site.baseurl }}></script>
  </head>

  <body>

    {% include_cached header.html %}

    <div class="page-content">
      <div class="wrapper">
        {{ content }}
      </div>
    </div>

    {% include_cached footer.html %}

  </body>

</html>
